import {createRouter,createMemoryHistory,createWebHashHistory,createWebHistory} from "vue-router"


// 1.声明routes配置
let routes =[
    {
        path:'/',
        component:()=>import ("../pages/home/index.vue"),
        name:"/",
        meta:{
            name:'导航首页'
        },
        children:[
            {
                path:"discover",
                name:'discover',
                meta:{
                    name:'发现'
                },
                component:()=>import("../pages/discover/index.vue"),
                children:[
                    {
                        path:'list',
                        name:'list',
                        meta:{
                            name:"歌单"
                        },
                        component:()=>import("../pages/discover/list/index.vue")
                    }
                ]
            },
            {
                path:"friend",
                name:'friend',
                meta:{
                    name:'朋友'
                },
                component:()=>import("../pages/friend/index.vue")

            },
            {
                path:"mine",
                name:"mine",
                meta:{
                    name:'个人中心'
                },
                component:()=>import("../pages/mine/index.vue")
            }
        ]
    },
    {
        path:"/login",
        name:"login",
        meta:{
            name:"登入页"
        },
        component:()=>import("../pages/login/index.vue")
    }
]
// 2.创建路由
let router =createRouter({
    history:createWebHashHistory('/base'),
    routes
})

// 导出路由
export default router